﻿<Page x:Class="PasswordProvider.View.GenericSiteDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:lib="clr-namespace:PasswordProvider.View.Library"
    Title="{Binding DisplayName}"
    ToolTip="{Binding ToolTip}">

    <DockPanel Height="Auto" Width="Auto">
        <WrapPanel HorizontalAlignment="Right" DockPanel.Dock="Bottom">
            <Button Width="60" Margin="5" 
                    IsDefault="{Binding CancelCommand.IsDefault}" 
                    Content="{Binding CancelCommand.DisplayName}"
				            Command="{Binding CancelCommand.Command}" 
                    />
            <Button Width="60" Margin="5"                    
                    IsDefault="{Binding CommitChangesCommand.IsDefault}"                    
                    Content="{Binding CommitChangesCommand.DisplayName}"
                    Command="{Binding CommitChangesCommand.Command}" 
                    />
        </WrapPanel>
        <Grid Margin="10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <TextBlock Margin="0,5,3,0" HorizontalAlignment="Left" Text="{Binding Name.DisplayName}"/>
            <TextBox Margin="0,5,0,0" Grid.Column="1" HorizontalAlignment="Stretch"
                    Text="{Binding Name.Text, UpdateSourceTrigger=PropertyChanged}" />
            
            <TextBlock Margin="0,5,3,0" Grid.Row="1" Text="{Binding Website.DisplayName}" />
            <lib:MultiComboBox Margin="0,5,0,0" Grid.Row="1" Grid.Column="1" 
                                  SelectionMode="Single"
                                  ItemsSource="{Binding Path=Website.List}"
                                  SelectedItem="{Binding Path=Website.SelectedItem}"
                                  HorizontalContentAlignment="Left"/>
                        
            <TextBlock Margin="0,5,3,0" Grid.Row="2" Text="{Binding Tags.DisplayName}" />
            <lib:MultiComboBox Margin="0,5,0,0" Grid.Row="2" Grid.Column="1" 
                                     SelectionMode="Multiple"
                                     ItemsSource="{Binding Path=Tags.List}"
                                     SelectedItems="{Binding Path=Tags.SelectedItems}"
                                     IsCreateNewEnabled="True"
                                     HorizontalContentAlignment="Left"
                                     DisplaySeparator=", "   />                        
                         
            <TextBlock Margin="0,10,3,3" Grid.Row="3" 
                       Text="{Binding Description.DisplayName}"/>
            <TextBox Grid.Row="4" Grid.ColumnSpan="2" MinHeight="100" TextWrapping="Wrap" AcceptsReturn="True"
                     Text="{Binding Description.Text, UpdateSourceTrigger=PropertyChanged}" />
                        
            <TextBlock Margin="0,20,3,0" Grid.Row="5" Text="{Binding Data.DisplayName}" />
            <lib:EncryptedValueEditBox Margin="0,20,0,0" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Stretch"
                                       IsEnabled="{Binding Data.IsEnabled}"
                                       IsReadOnly="{Binding Data.IsReadOnly}"
                                       ToolTip="{Binding Data.ToolTip}"
                                       DisplayString="{Binding Data.DisplayString, Mode=TwoWay}" />      
            
            <CheckBox Margin="0,3,0,0" Grid.Row="6" Grid.Column="1" 
                                  Content="{Binding ShowHidden.DisplayName}"
                                  IsEnabled="{Binding ShowHidden.IsEnabled}"
                                  IsChecked="{Binding ShowHidden.IsChecked}"/>
                    
        </Grid>
    </DockPanel>
</Page>
